<?php
/**
 * Created by PhpStorm.
 * User: Fenn
 * Date: 2018/6/3
 * Time: 22:38
 */

namespace App\Transformers;

use App\Models\User;
use League\Fractal\TransformerAbstract;

class UserTransformer extends TransformerAbstract
{


    public function transform(User $user){
        return [
            'userid'       => $user->id,
            'username'     => $user->username,
            'phone'        => $user->phone,
            'token'        => $user->token,
            'token_expire' => $user->token_expire,
        ];
    }
}